 //document.write("<script language='javascript' src='../js/Ajax.js'></script>");
 /**
 收货人信息1 id=addressDiv
 收货人信息2 id=updateAddressDiv
 付款方式1 id=payDiv
 付款方式2 id=updatePayDiv
 配送方式1 id=deliverDiv
 配送方式2 id=updateDeliverDiv
 商品显示  id=bigdiv
  */
  
 //所有省、市、区
 allCityName="";
 //付款方式id集合
 paymentList="";
 //配送方式id集合
 deliverList="";
 //客户选择的付款方式id
 checkedPaymentid="";
 //客户若选择银行支付，手续费率
 Interestrates=0;
 //设置所有内容是否符合提交订单的标准 0 不符合 1 符合
 isSubmit=0;
 //设置发票抬头是否为空的变量。0为正常 1为不正常。
 isFaPiaoTop=0;
  //根据id隐藏获得的对象
  function closeDom(id){
    var htmlDom=document.getElementById(id);
    if(htmlDom){
      htmlDom.style.display="none";
    }
  }
  //根据id显示获得的对象
  function openDom(id){
    var htmlDom=document.getElementById(id);
    if(htmlDom){
      htmlDom.style.display="";
    }
  }
  //判断select控件中这个项是否存在
  function optionWhere(selectO,OptionValue){
    var bool=false;
    for(var i=0;i<selectO.options.length;i++){
       if(selectO.options[i].value==OptionValue){
          bool=true;
          break;
       }
    }
    return bool;
  }
  //设置指定的项被选中
  function selectchecked(selectO,OptionValue){
    if(optionWhere(selectO,OptionValue)){
       for(var i=0;i<selectO.options.length;i++){
       if(selectO.options[i].value==OptionValue){
          selectO.options[i].selected=true;
          break;
       }
    }
    }
  }
  //**************************收货人信息开始***********************************************
  //将客户编辑过的收货人信息保存到第一部分
  function editAddressDiv(){
      var raidovalues=document.getElementsByName("radioAddress");//所有地址
      var raidovalue=3;//id编号，方便循环获取控件，默认其他地址被选中
      for(var i=0;i<raidovalues.length;i++){
         if(raidovalues[i].checked==true){
           raidovalue=raidovalues[i].value;
         }
      }
      //收货人姓名
      var textUserName=document.getElementById("textUserName"+raidovalue);
      if(textUserName.value==""){
        alert("收货人姓名不能为空!");
        return;
      }
      //省
      var selectProvince=document.getElementById("selectProvince"+raidovalue);
      if(selectProvince.value=="请选择"){
      		alert("请选择省份");
      		return;
      }
      //市
      var selectCity=document.getElementById("selectCity"+raidovalue);
      if(selectCity.value=="请选择"){
      		alert("请选择城市");
      		return;
      }
      //区
      var selectVillage=document.getElementById("selectVillage"+raidovalue);
      if(selectVillage.value=="请选择"){
      		alert("请选择区县");
      		return;
      }
      //地址
      var textAddress=document.getElementById("textAddress"+raidovalue);
      if(textAddress.value==""){
        alert("收货地址不能为空!");
        return;
      }
      //邮编
      var textzip=document.getElementById("textzip"+raidovalue);
      var pattern =/^[0-9]{6}$/;
      if(textzip.value!=""){
      	if(!pattern.exec(textzip.value)){
        	alert('请输入正确的邮政编码，如160000');
        	return;
        }
      }else{   
        alert("邮编不能为空!");
        return;
      }
      //固定电话
      var textphone=document.getElementById("textphone"+raidovalue);
      var pattern = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
      if(textphone.value!=""){
      	if(!pattern.exec(textphone.value)){
      		alert('请输入正确的固定电话,如010-63458858或010-63458858-025');
      		return;
      	}
      }
      
      //手机号码
      var textmobile=document.getElementById("textmobile"+raidovalue);
      var ss = /^(?:13\d|15\d|18\d)-?\d{5}(\d{3}|\*{3})$/;
      if(textmobile.value!=""){
      	if (!(ss.test(textmobile.value))){
        	alert('请输入正确的手机号码,如13501284888或15811445345');
        	return;
        }
      }else{	
        	alert("手机号码不能为空!");
        	return;
      }
      //电子邮件
      var textemail=document.getElementById("textemail"+raidovalue);
      var pattern =/(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
      if(textemail.value!=""){
      	if(!pattern.exec(textemail.value)){
        	alert('请输入正确的邮箱地址。如wojiuxihuan@163.com或cn.ryan@sina.com');
        	return;
		}
      }else{
        alert("电子邮件不能为空!");
        return;
      }
      /*将选中信息整合到第1部分*/
      //收货人姓名
      var consignee=document.getElementById("consignee");
      consignee.innerHTML=textUserName.value;
      var hiddconsignee=document.getElementById("hiddconsignee");
      hiddconsignee.value=textUserName.value;
      //省市区
      var province=document.getElementById("province");//显示部分
          province.innerHTML=selectProvince.value+"-"+selectCity.value+"-"+selectVillage.value;
      var hiddcity=document.getElementById("hiddcity");
          hiddcity.value=selectProvince.value+"-"+selectCity.value+"-"+selectVillage.value;

      //地址
      var address=document.getElementById("address");
          address.innerHTML=textAddress.value;
      var hiddaddress=document.getElementById("hiddaddress");
          hiddaddress.value=textAddress.value;
      //邮编
      var postcode=document.getElementById("postcode");
      postcode.innerHTML=textzip.value;
      var hiddpostcode=document.getElementById("hiddpostcode");
      hiddpostcode.value=textzip.value;
      //固定电话
      var phone=document.getElementById("phone");
      phone.innerHTML=textphone.value;
      var hiddphone=document.getElementById("hiddphone");
      hiddphone.value=textphone.value;
      //手机号码
      var mobile=document.getElementById("mobile");
      mobile.innerHTML=textmobile.value;
      var hiddmobile=document.getElementById("hiddmobile");
      hiddmobile.value=textmobile.value;
      //电子邮件：
      var email=document.getElementById("email");
      email.innerHTML=textemail.value;
      var hiddemail=document.getElementById("hiddemail");
      hiddemail.value=textemail.value;
      //省,市,区
      allCityName=selectProvince.value+","+selectCity.value+","+selectVillage.value;
     
     //查询付款方式和支付方式
     getPayment();

     /*根据id显示隐藏层*/
     openDiv('updateAddressDiv','addressDiv');
     closeDom('payDiv');
     openDom('updatePayDiv');
     closeDom('updateDeliverDiv');
     //openDom('deliverDiv');
     
  }
  //根据城市查询付款方式和配送方式集合
  function getPayment(){
      //获得所有付款方式集合
      var radios=document.getElementsByName("radio");
      for(var i=0;i<radios.length;i++){
         radios[i].checked=false;//设置所有的付款方式不选中
      }
      
      if(allCityName){
          var cityArray=allCityName.split(",");
          var ajax=new Ajax();
          //根据城市查询付款方式和配送方式集合
          ajax.ajaxRequest(jsCtx+"/order/cityOreder.do","method=getPaymentAndDeliver&provinceName="+encodeURI(cityArray[0])+"&cityName="+encodeURI(cityArray[1])+"&villageName="+encodeURI(cityArray[2]),"get",backPayment);
      }else{
          alert("请填写收货信息！");
      }
  }
  
  function backPayment(str){
  //城市id|支付方式id集合|配送方式id集合
      var strs=str.split("|");
      //需要ajax查询获得指定的省市区的唯一编号
      var hiddocity=document.getElementById("hiddocity");
      hiddocity.value=strs[0];
      //支付方式集合
      var payments=strs[1].split(",");
      //设置所有的付款方式选项不显示
      var ceng201=document.getElementById("ceng201");
          ceng201.style.display="none";
          var ceng30=document.getElementById("ceng30");
          ceng30.style.display="none";
      var ceng202=document.getElementById("ceng202");
          ceng202.style.display="none";
          var ceng31=document.getElementById("ceng31");
          ceng31.style.display="none";
      var ceng203=document.getElementById("ceng203");
          ceng203.style.display="none";
          var ceng32=document.getElementById("ceng32");
          ceng32.style.display="none";
      var ceng204=document.getElementById("ceng204");
          ceng204.style.display="none";
          var ceng33=document.getElementById("ceng33");
          ceng33.style.display="none";
      var ceng205=document.getElementById("ceng205");
          ceng205.style.display="none";
          var ceng34=document.getElementById("ceng34");
          ceng34.style.display="none";
      var ceng206=document.getElementById("ceng206");
          ceng206.style.display="none";
          var ceng35=document.getElementById("ceng35");
          ceng35.style.display="none";
      var ceng207=document.getElementById("ceng207");
          ceng207.style.display="none";
          var ceng36=document.getElementById("ceng36");
          ceng36.style.display="none";
      //显示符合条件的付款方式
      for(var i=0;i<payments.length;i++){
         if(payments[i]==1){
            ceng201.style.display="";
         }
         if(payments[i]==2){
            ceng202.style.display="";
         }
         if(payments[i]==3){
            ceng204.style.display="";
         }
         if(payments[i]==4){
            ceng203.style.display="";
         }
         if(payments[i]==5){
            ceng205.style.display="";
         }
         if(payments[i]==6){
            ceng206.style.display="";
         }
         if(payments[i]==7){
            ceng207.style.display="";
         }
      }
      
      //配送方式集合
      var delivers=strs[2];;
      deliverList=delivers;
  }
  

  
//**************付款方式*开始**********************************
  function editPayDiv(){
      //先清空手续费率
      Interestrates=0;
      //页面显示结果
      var spanpname=document.getElementById("spanpname");
      //下个页面需要显示的内容与页面显示结果相同
      var hiddpname=document.getElementById("hiddpname");
      //付款方式id
      var paymentid=document.getElementById("hiddpaymentid");
      //付款银行
      var payBank=document.getElementById("payBank");
      payBank="";
      //期数和手续费
      var payBankPoundage=document.getElementById("payBankPoundage");
      payBankPoundage.value="";
      /***********************变量结束***************************/
      //获得所有的付款方式radio
      var payments=document.getElementsByName("radio");
      //用于判断有没有选择付款方式
      var isbool=false;
      for(var i=0;i<payments.length;i++){
          //判断有没有被选中
          if(payments[i].checked==true){
              isbool=true;
              var payOne=payments[i].value;
              var payTwo=payOne.split(",");
              spanpname.innerHTML=payTwo[1];
              paymentid.value=payTwo[0];
              hiddpname.value=payTwo[1];
              //客户选择付款方式
              checkedPaymentid=payTwo[0];
              if(payTwo[0]=="3"){//如果是信用卡分期付款
                  //选择的银行集合
                  var banks = document.getElementsByName("radio_a5");
                  //用于判断有没有选择银行
                  var isBankBool=false;
                  for(var j=0;j<banks.length;j++){
                     if(banks[j].checked==true){//判断银行有没有被选中
                         isBankBool=true;
                         //设置付款银行
                         payBank.value=banks[j].value;
                         if(banks[j].value=="中国银行"){//判断选的是不是中国银行
                             var periods=document.getElementsByName("radio_a5Item1");//获得中国银行下的期数于手续费集合
                             var isPeriodsBool=false;//用于判断有没有选择期数手续费
                             for(var k=0;k<periods.length;k++){
                                if(periods[k].checked==true){
                                   isPeriodsBool=true;
                                   payBankPoundage.value=periods[k].value;
                                }
                             }
                             if(!isPeriodsBool){
                                alert("请选择用几期的信用卡付款！");
                                return;
                             }
                         }
                         if(banks[j].value=="兴业银行"){//判断选的是不是兴业银行
                             var periods=document.getElementsByName("radio_a5Item2");//获得兴业银行下的期数于手续费集合
                             var isPeriodsBool=false;//用于判断有没有选择期数手续费
                             for(var k=0;k<periods.length;k++){
                                if(periods[k].checked==true){
                                   isPeriodsBool=true;
                                   payBankPoundage.value=periods[k].value;
                                }
                             }
                             if(!isPeriodsBool){
                                alert("请选择用几期的信用卡付款！");
                                return;
                             }
                         }
                     }
                  }
                  //判断有没有选择银行
                  if(!isBankBool){
                     alert("请选择银行!");
                     return;
                  }
              }
          }
      }
      if(!isbool){
        alert("请选择付款方式！");
        return;
      }
      
     //根据城市限制的配送方式和付款方式限制的配送方式显示配送方式
     getDeliver();
     //显示隐藏相关层
     openDiv('updatePayDiv','payDiv');
     closeDom('deliverDiv');
     openDom('updateDeliverDiv');
     
  }

  //**************配送方式*开始**********************************
  function editDeliverDiv(){
      //显示配送方式
      var spandeliver=document.getElementById("spandeliver");
      //参数配送方式id
      var deliverid=document.getElementById("deliverid");
  
      //获得所有配送方式
      var radiopays=document.getElementsByName("radiopay");
      //用于判断是否选择了配送方式
      var isRadiopayBool=false;
      for(var i=0;i<radiopays.length;i++){
          if(radiopays[i].checked==true){
              isRadiopayBool=true;
              var strs=radiopays[i].value;
              var str=strs.split(",");
              spandeliver.innerHTML=str[1];
              deliverid.value=str[0];
          }
      }
      if(!isRadiopayBool){
          alert("请选择配送方式！");
          return;
      }
      //期数和手续费
      var payBankPoundage=document.getElementById("payBankPoundage");
      
      if(payBankPoundage.value!=""){
          //手续费率
          Interestrates=((payBankPoundage.value).split(","))[1];
      }
      //手续费
      //var spanPoundage=document.getElementById("poundage");
      //spanPoundage.innerHTML=poundage;
      
      //****查询配送费用
      var ajax=new Ajax();
      ajax.ajaxRequest(jsCtx+"/order/cityOreder.do","method=getPrice&deliverid="+deliverid.value,"get",backPrice);
      //显示隐藏相关层
      openDiv('updateDeliverDiv','deliverDiv');
      openDom('bigdiv');
      //可以提交订单了
      isSubmit=1;
  }
  //返回运费信息
  function backPrice(num){
      var freight=document.getElementById("freight");//获得显示运费对象
          freight.innerHTML=(new Number(num)).toFixed(2);
      var needcarriage=document.getElementById("needcarriage");
          needcarriage.value=(new Number(num)).toFixed(2);
      //checkout页面的计算求和
      checkoutCountSum();
  }
  
  //checkout页面的计算求和
  function checkoutCountSum(){
     //商品金额共计
     var spanTotalSum=document.getElementById("spanTotalSum");
     var totalSumNum=new Number(spanTotalSum.innerHTML);
     //手续费
     var poundage=document.getElementById("poundage");
     var hiddpoundage=document.getElementById("hiddpoundage");
     var poundageNum=new Number(poundage.innerHTML);
     //运费hidden                           
     var needcarriage=document.getElementById("needcarriage");
     var needcarriageNum=new Number(needcarriage.value);
     //使用帐户余额
     var hiddusebalance=document.getElementById("hiddusebalance");
     var balanceNum=new Number(hiddusebalance.value);
     //使用积分
     var hiddusepoint=document.getElementById("hiddusepoint");
     var usepointNum=new Number(hiddusepoint.value);
     //您共需要支付span
     var needPrice=document.getElementById("needPrice");
     //您共需要支付hidden
     var needpay=document.getElementById("needpay");
     //您使用优惠卷优惠的金额
     var shen = new Number(document.getElementById("shen").innerHTML);
     //显示优惠券冲抵金额
     var useticketSpan=document.getElementById("useticket");
     useticketSpan.innerHTML=shen;
     //判断是否免运费
     var freeDeliver=document.getElementsByName("freeDeliver");
     var freight=document.getElementById("freight");//获得显示运费对象
     for(var i=0;i<freeDeliver.length;i++){
         if(freeDeliver[i].value==1){
             needcarriageNum=0;
             freight.innerHTML=needcarriageNum.toFixed(2);
             needcarriage.value=needcarriageNum.toFixed(2);
         }
     }
     
     //该取的都取了，开始计算
     //需要支付金额=商品金额共计+运费-使用帐户余额-使用积分-优惠卷金额
     var sum=totalSumNum+needcarriageNum-balanceNum-usepointNum-shen;
     //手续费=需要支付金额*手续费率
     poundageNum=sum*Interestrates;
     //显示手续费
     poundage.innerHTML=poundageNum.toFixed(2);
     hiddpoundage.value=poundageNum.toFixed(2);
     //显示实际支付金额     需要支付金额 +手续费
     needPrice.innerHTML=(sum+poundageNum).toFixed(2);
     needpay.value=(sum+poundageNum).toFixed(2);
  }
  
  //根据城市限制的配送方式和付款方式限制的配送方式显示配送方式
  function getDeliver(){
      var radiopays=document.getElementsByName("radiopay");
      for(var i=0;i<radiopays.length;i++){
          radiopays[i].checked=false;
      }
      
      //设置所有的配送方式不显示
      var ceng208=document.getElementById("ceng208");
          ceng208.style.display="none";
          var pay02=document.getElementById("pay02");
          pay02.style.display="none";
          
      var ceng211=document.getElementById("ceng211");
          ceng211.style.display="none";
          var pay05=document.getElementById("pay05");
          pay05.style.display="none";
          
      var ceng212=document.getElementById("ceng212");
          ceng212.style.display="none";
          var pay06=document.getElementById("pay06");
          pay06.style.display="none";
          
      var ceng215=document.getElementById("ceng215");
          ceng215.style.display="none";
          var pay09=document.getElementById("pay09");
          pay09.style.display="none";
          
      var ceng216=document.getElementById("ceng216");
          ceng216.style.display="none";
          var pay10=document.getElementById("pay10");
          pay10.style.display="none";
      //设置所有的配送方式不显示******结束
      //拆分配送方式id集合
      var delivers=deliverList.split(",");
      if(checkedPaymentid==""){
          alert("请先选择付款方式");
          return;
      }else{
          if(checkedPaymentid=="1" || checkedPaymentid=="2" ||checkedPaymentid=="3" ||checkedPaymentid=="6"){
              for(var i=0;i<delivers.length;i++){
                  if(delivers[i]=="2"){
                      ceng208.style.display="";
                  }
                  if(delivers[i]=="5"){
                      ceng211.style.display="";
                  }
                  if(delivers[i]=="6"){
                      ceng212.style.display="";
                  }
              }
          }
          if(checkedPaymentid=="5" || checkedPaymentid=="7"){
              for(var i=0;i<delivers.length;i++){
                  if(delivers[i]=="10"){
                      ceng216.style.display="";
                  }
              }
          }
          if(checkedPaymentid=="4"){
              for(var i=0;i<delivers.length;i++){
                  if(delivers[i]=="9"){
                      ceng215.style.display="";
                  }
              }
          }
      }
  }
 
 
 
 //修改使用余额
function editCash(){
  
    //获取用户输入余额text
    var cashText=document.getElementById("userbalance1");
    //可输入余额最大值span
    var cashMax=document.getElementById("cash");
    //判断是否大于最大值
    var cashTextNum=new Number(cashText.value);
    var cashMaxNum=new Number(cashMax.innerHTML);
    var pattern = /^[1-9]\d*$/;
    if(cashTextNum!=""){
    	if(!pattern.exec(cashTextNum)){
    		alert("请输入大于零的数字！");
        	return;
    	}
    	if(cashTextNum>cashMaxNum){
        	alert("帐户余额不足！请重新输入！");
        	return;
    	}
    }
    //已经使用的帐户余额
    var usebalance=document.getElementById("usebalance");
    //您共需要支付span
    var needPrice=document.getElementById("needPrice");
    //要使用的余额>共需要支付的
    var aa=new Number(cashText.value);
    var bb=new Number(needPrice.innerHTML);
    if(aa>bb){
        alert("使用余额必须小于需要支付的金额！");
        return;
    }
    //计算位置要显示的值
    usebalance.innerHTML=cashTextNum.toFixed(2);
    //计算位置要使用的值
    var hiddusebalance=document.getElementById("hiddusebalance");
    hiddusebalance.value=cashTextNum.toFixed(2);
    
    //重新计算和
    checkoutCountSum();
}
//修改使用积分
function editUserPoint(){

    //获取用户输入积分
    var pointText=document.getElementById("usepoint1");
    //可输入积分最大值span
    var pointMax=document.getElementById("userPoint");
    //判断是否大于最大值
    var pointTextNum=new Number(pointText.value);
    var pointMaxNum=new Number(pointMax.innerHTML);
    var pattern = /^[1-9]\d*$/;
    if(pointTextNum!=""){
    	if(!pattern.exec(pointTextNum)){
    		alert("请输入大于零的数字！");
        	return;
    	}
    	if(pointTextNum>pointMaxNum){
        	alert("积分余额不足！请重新输入！");
        	return;
    	}
    }
    //您共需要支付span
    var needPrice=document.getElementById("needPrice");
    var aa=new Number(pointText.value);
    var bb=new Number(needPrice.innerHTML);
    if(aa>bb){
       alert("使用的积分必须小于需要支付的金额！");
       return;
    }
    
    var usepointSpan=document.getElementById("usepoint");
        usepointSpan.innerHTML=pointTextNum;
    var hiddusepoint=document.getElementById("hiddusepoint");
        hiddusepoint.value=pointTextNum;
    //重新计算和
    checkoutCountSum();
}
//********************0*关联显示ceng30*****************************
var state0 = 0; //0:hide 1:show
var id0 = null;
function show0(targetbox)
{
var showtarget0 = document.getElementById(targetbox);
if(id0!=null && id0 != showtarget0){
   id0.style.display = "none";
   state0 = 0;
}
if(state0==0){
   showtarget0.style.display = "block";
   state0=1;
}
else{
   showtarget0.style.display = "none";
   state0=0;
}
id0 = showtarget0;
}
//编辑发票信息
function editInvioce(){
    //获得发票类型checked
    var invoicetype=document.getElementsByName("invoicetype");
   //设置发票类型span
    var spanInvoicetype=document.getElementById("spanInvoicetype");
    
    //获得发票抬头text
    var invoicecompanytText=document.getElementById("invoicecompanytText");
    //设置发票抬头span
    var spanInvoicecompanytText=document.getElementById("spanInvoicecompanytText");
    
    
  
    //获得发票内容checked
    var invoicecontent=document.getElementsByName("invoicecontent");
    //设置发票内容span
    var spanInvoicecontent=document.getElementById("spanInvoicecontent");
  
    for(var i=0;i<invoicetype.length;i++){
        if(invoicetype[i].checked==true){
            var invoiceValue=invoicetype[i].value;
            if(invoiceValue==2){//1增值税发票
                spanInvoicetype.innerHTML="增值税发票";
                spanInvoicecontent.innerHTML="";
                spanInvoicecompanytText.innerHTML="";
            }else{//0普通发票
                spanInvoicetype.innerHTML="普通发票";
                //发票抬头
                spanInvoicecompanytText.innerHTML=invoicecompanytText.value;
                for(var i=0;i<invoicecontent.length;i++){
                    if(invoicecontent[i].checked==true){
                        if(invoicecontent[i].value==1){//明细
                            spanInvoicecontent.innerHTML="明细";
                        }
                        if(invoicecontent[i].value==2){//办公用品
                            spanInvoicecontent.innerHTML="办公用品";
                        }
                        if(invoicecontent[i].value==3){//电脑配件
                            spanInvoicecontent.innerHTML="电脑配件";
                        }
                        if(invoicecontent[i].value==4){//耗材
                            spanInvoicecontent.innerHTML="耗材";
                        }
                    }
                }
            }
        }
    }
  
  

    
    
    
}

/***************************根据省市区查询邮编***********************************/

function getZip(idd,backZip){
    //省
    var selectProvince=document.getElementById("selectProvince"+idd);
    var provinceName=selectProvince.options[selectProvince.selectedIndex].value;
    //市
   	var selectCity=document.getElementById("selectCity"+idd);
    var cityName=selectCity.options[selectCity.selectedIndex].value;
    //区
    var selectVillage=document.getElementById("selectVillage"+idd);
    var villageName=selectVillage.options[selectVillage.selectedIndex].value;
    var ajax=new Ajax();
  
    ajax.ajaxRequest(jsCtx+"/order/cityOreder.do","method=getZip&provinceName="+encodeURI(provinceName)+"&cityName="+encodeURI(cityName)+"&villageName="+encodeURI(villageName),"get",backZip);
}

function backZip0(zip){
    var textzip=document.getElementById("textzip0");
    textzip.value=zip;
}
function backZip1(zip){
    var textzip=document.getElementById("textzip1");
    textzip.value=zip;
}
function backZip2(zip){
    var textzip=document.getElementById("textzip2");
    textzip.value=zip;
}
function backZip3(zip){
    var textzip=document.getElementById("textzip3");
    textzip.value=zip;
}

//**********************1*配送方式*****************************
var state1 = 0; //0:hide 1:show
var id1 = null;
function show1(targetbox)
{
var showtarget1 = document.getElementById(targetbox);
if(id1!=null && id1 != showtarget1){
   id1.style.display = "none";
   state1 = 0;
}
if(state1==0){
   showtarget1.style.display = "block";
   state1=1;
}
else{
   showtarget1.style.display = "none";
   state1=0;
}
id1 = showtarget1;
}
//**********************2*关联显示ceng407*****************************
var state2 = 0; //0:hide 1:show
var id2 = null;
function show2(targetbox)
{
var showtarget2 = document.getElementById(targetbox);
if(id2!=null && id2 != showtarget2){
   id2.style.display = "none";
   state2 = 0;
}
if(state2==0){
   showtarget2.style.display = "block";
   state2=1;
}
else{
   showtarget2.style.display = "none";
   state2=0;
}
id2 = showtarget2;
}
//**************付款方式*结束**********************************